package atm.com.controller.stream;

import atm.com.pojo.Bankcard;
import atm.com.pojo.Cashdispenser;
import atm.com.pojo.Stream;
import atm.com.service.stream.StreamServiceInf;
import atm.com.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * AdminController class
 * @author di zhang
 * @date 2021/8/24
 */
@CrossOrigin(value = "http://localhost:5325")
@RestController
public class StreamController {
    @Autowired
    private StreamServiceInf streamServiceInf;

    /**该银行卡的 一周流水*/
    @RequestMapping("ListStreamByBankcard")
    public List<Stream>  ListStreamByBankcard(HttpSession session){
        CommonUtil commonUtil =new CommonUtil();
        Bankcard bankcard=(Bankcard) session.getAttribute(commonUtil.BANK_CARD);
        return streamServiceInf.ListStreamByBankCardId(bankcard);
    }


}
